﻿<UserControl x:Class="EpiDashboard.Controls.DashboardProperties"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:Controls="clr-namespace:EpiDashboard.Controls"
             mc:Ignorable="d" 
             d:DesignHeight="460" d:DesignWidth="800" FontFamily="Global User Interface" FontSize="16" Background="White">
    <UserControl.Resources>
            <ResourceDictionary>
                <ResourceDictionary.MergedDictionaries>
                    <ResourceDictionary Source="../StyleDictionary.xaml"/>
                </ResourceDictionary.MergedDictionaries>
            </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width=".37*" />
            <ColumnDefinition Width="30" />
            <ColumnDefinition Width=".63*" />
        </Grid.ColumnDefinitions>
        
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        
        <!--<Border Grid.ColumnSpan="100" Grid.RowSpan="100" BorderThickness="2" BorderBrush="#DDDDDD" />-->

        <StackPanel Grid.Column="0" Grid.RowSpan="3" x:Name="panelSidebar" Background="{StaticResource PrimaryAccentColorLight}">
            <Label FontWeight="Light" Foreground="White" FontSize="56" Margin="0, 0, 0, 10">Properties</Label>

            <!--<ToggleButton x:Name="tbtnDataSource" Style="{StaticResource ToggleSidebarButtonStyle}" IsChecked="True" Checked="tbtnDataSource_Checked">
                <StackPanel>
                    <TextBlock Margin="4" FontSize="28" FontWeight="Light">Data Source</TextBlock>
                    <TextBlock Margin="4, 0, 4, 0" FontSize="12" TextWrapping="WrapWithOverflow">Change the data source for the current canvas.</TextBlock>
                </StackPanel>
            </ToggleButton>-->

            <Controls:SettingsToggleButton  x:Name="tbtnDataSource" Title="Data Source" Description="Change the data source for the current canvas." IsChecked="True" Checked="tbtnDataSource_Checked"/>
            <Controls:SettingsToggleButton  x:Name="tbtnHTML" Title="HTML Output" Description="Modify the HTML output settings." IsChecked="False" Checked="tbtnHTML_Checked"/>
            <Controls:SettingsToggleButton  x:Name="tbtnCharts" Title="Charts" Description="Set default chart settings for this canvas." IsChecked="False" Checked="tbtnCharts_Checked"/>
            <Controls:SettingsToggleButton  x:Name="tbtnInfo" Title="Information" Description="View technical details about this canvas." IsChecked="False" Checked="tbtnInfo_Checked"/>

            <!--<ToggleButton x:Name="tbtnHTML" Style="{StaticResource ToggleSidebarButtonStyle}" Checked="tbtnHTML_Checked">
                <StackPanel>
                    <TextBlock Margin="4" FontSize="28" FontWeight="Light">HTML Output</TextBlock>
                    <TextBlock Margin="4, 0, 4, 0" FontSize="12" TextWrapping="WrapWithOverflow">Modify the HTML output settings.</TextBlock>
                </StackPanel>
            </ToggleButton>

            <ToggleButton x:Name="tbtnCharts" Style="{StaticResource ToggleSidebarButtonStyle}" Checked="tbtnCharts_Checked">
                <StackPanel>
                    <TextBlock Margin="4" FontSize="28" FontWeight="Light">Charts</TextBlock>
                    <TextBlock Margin="4, 0, 4, 0" FontSize="12" TextWrapping="WrapWithOverflow">Set default chart settings for this canvas.</TextBlock>
                </StackPanel>
            </ToggleButton>

            <ToggleButton x:Name="tbtnInfo" Style="{StaticResource ToggleSidebarButtonStyle}" Checked="tbtnInfo_Checked">
                <StackPanel>
                    <TextBlock Margin="4" FontSize="28" FontWeight="Light">Information</TextBlock>
                    <TextBlock Margin="4, 0, 4, 0" FontSize="12" TextWrapping="WrapWithOverflow">View technical details about this canvas.</TextBlock>
                </StackPanel>
            </ToggleButton>-->
        </StackPanel>

        <StackPanel x:Name="panelDataSource" Grid.Column="2" Margin="0, 0, 10, 0" Visibility="Visible">
            <Label Style="{StaticResource PropertiesHeading}" Margin="0, 0, 0, 10">Data Source</Label>

            <StackPanel x:Name="panelDataSourceProject" Visibility="Visible">
                <Label>Epi Info 7 Project:</Label>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition Width="12" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <TextBox x:Name="txtProjectPath" IsReadOnly="True" TextChanged="txtProjectPath_TextChanged"></TextBox>
                    <Button x:Name="btnBrowse" Height="Auto" Grid.Column="2" Click="btnBrowse_Click">Browse</Button>
                </Grid>

                <Label>Form:</Label>
                <ComboBox x:Name="cmbFormName" SelectionChanged="cmbFormName_SelectionChanged"></ComboBox>

                <Label x:Name="lblRelatedDataSources">Related Data Sources:</Label>
                <ListBox x:Name="lbxRelatedDataSources" MinHeight="100"></ListBox>
            </StackPanel>

            <StackPanel x:Name="panelDataSourceOther" Visibility="Collapsed">
                <Label>Connection String:</Label>
                <TextBox x:Name="txtDataSource" Margin="0,0,0,8" />
            </StackPanel>

            <StackPanel x:Name="panelDataSourceAdvanced" Visibility="Collapsed">
                <Label>SQL Query:</Label>
                <TextBox x:Name="txtSQLQuery"></TextBox>
            </StackPanel>
        </StackPanel>

        <StackPanel x:Name="panelHTML" Grid.Column="2" Margin="8" Visibility="Collapsed">
            <Label Style="{StaticResource PropertiesHeading}" Margin="0, 0, 0, 10">HTML Output</Label>

            <Label>Title:</Label>
            <TextBox x:Name="txtTitle"></TextBox>

            <Label>Summary:</Label>
            <TextBox x:Name="txtSummary"></TextBox>

            <Label>Conclusion:</Label>
            <TextBox x:Name="txtConclusion"></TextBox>

            <CheckBox x:Name="checkboxGadgetHeadings" Content="Show gadget headings" IsChecked="True" Margin="0,16,0,16" />
            <CheckBox x:Name="checkboxGadgetSettings" Content="Show gadget settings" IsChecked="True" Margin="0,0,0,16" />
            <CheckBox x:Name="checkboxCanvasSummary" Content="Show canvas summary" IsChecked="True" Margin="0,0,0,16" />
            <CheckBox x:Name="checkboxAlternateColors" Content="Use alternating colors in tables" IsChecked="False" Margin="0,0,0,16" />
            <CheckBox x:Name="checkboxTopToBottom" Content="Display gadgets in top-to-bottom order" IsChecked="True" Margin="0,0,0,16" />

        </StackPanel>

        <StackPanel x:Name="panelInfo" Grid.Column="2" Margin="8" Visibility="Collapsed">
            <Label Style="{StaticResource PropertiesHeading}" Margin="0, 0, 0, 10">Canvas Information</Label>

            <TextBlock x:Name="tblockRows" Text="2,255 unfiltered rows" Margin="0,0,0,16" />
            <TextBlock x:Name="tblockColumns" Text="252 columns" Margin="0,0,0,16" />
            <TextBlock x:Name="tblockCacheDateTime" Text="Data last cached at 12/16/2011 1:56 PM" Margin="0,0,0,16" />
            <TextBlock x:Name="tblockCacheTimeElapsed" Text="Took 4:32:32 to locally cache data" Margin="0,0,0,16" />
            <TextBlock x:Name="tblockCurrentEpiVersion" Text="Epi Info 7.0.0.0" Margin="0,0,0,16" />
        </StackPanel>

        <StackPanel x:Name="panelCharts" Grid.Column="2" Margin="8" Visibility="Collapsed">
            <Label Style="{StaticResource PropertiesHeading}" Margin="0, 0, 0, 10">Chart Settings</Label>

            <Label>Default Width:</Label>
            <TextBox x:Name="txtDefaultChartWidth">800</TextBox>

            <Label>Default Height:</Label>
            <TextBox x:Name="txtDefaultChartHeight">500</TextBox>
        </StackPanel>
        
        <Button Style="{StaticResource CloseButtonStyle}" Grid.Column="2" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="8" Click="CloseButton_Click" />

        <DockPanel Grid.ColumnSpan="3" Grid.Row="1">
            <Button x:Name="btnCancel" DockPanel.Dock="Right" HorizontalAlignment="Right" Margin="8" Width="134" Height="42" Click="btnCancel_Click">Cancel</Button>
            <Button x:Name="btnOK" DockPanel.Dock="Right" HorizontalAlignment="Right" Margin="8" Width="134" Height="42" Click="btnOK_Click">OK</Button>
        </DockPanel>
    </Grid>
</UserControl>
